package com.gaogzhen.intro.commonMethod;

import lombok.extern.slf4j.Slf4j;

@Slf4j(topic = "cm.test01")
public class CMInterrupt {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
                log.debug("sleep...");
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
        });

        t1.start();
        Thread.sleep(100);
        log.debug("interrupt...");
        t1.interrupt();
        log.debug("t1 的打断标记：{}", t1.isInterrupted());
    }
}
